package com.schooleducation.service;

import java.util.List;

import com.schooleducation.entity.Lesson;
import com.schooleducation.entity.LessonContent;
import com.schooleducation.entity.LessonContentInfo;
import com.schooleducation.entity.LessonInfo;
import com.schooleducation.entity.LessonOneType;
import com.schooleducation.entity.LessonSubscribe;
import com.schooleducation.entity.LessonTwoType;
import com.schooleducation.entity.User;

/**
 * 课程操作service
 * @author weijing
 *
 */
public interface LessonService {

	/**
	 * 获取课程类型列表
	 * @return
	 */
	public List<LessonOneType> getLessonTypeAll();
	
	/**
	 * 获取订阅课程数量
	 * @return
	 */
	public Long getSubscribeLessonCount();
	
	/**
	 * 获取订阅课程列表
	 * @return
	 */
	public List<LessonSubscribe> getSubscribeLesson(User user, int page);
	
	/**
	 * 获取课程列表
	 * @param page
	 * @return
	 */
	public List<Lesson> getLessonList(int page);
	
	/**
	 * 添加课程
	 * @param lesson
	 * @return
	 */
	public boolean addLesson(Lesson lesson);
	
	/**
	 * 获取教师的课程列表
	 * @param teacher
	 * @return
	 */
	public List<Lesson> getLessonListByTeacher(User teacher);
	
	/**
	 * 添加课程内容
	 * @param lc
	 * @return
	 */
	public boolean addLessonContent(LessonContent lc);
	
	/**
	 * 订阅课程
	 * @param ls
	 * @return
	 */
	public boolean addSubscribeLesson(LessonSubscribe ls);
	
	/**
	 * 获取课程的章节列表
	 * @param lessonId
	 * @return
	 */
	public List<LessonContent> getLessonContentList(int lessonId);
	
	/**
	 * 获取相应章节的内容
	 * @param lessonContentId
	 * @return
	 */
	public LessonContentInfo getLessonContentInfo(int lessonContentId);
	
	/**
	 * 获取课程的基础信息
	 * @param id
	 * @return
	 */
	public Lesson getLessonById(int id);
	
	/**
	 * 按课程列表获取课程列表
	 * @param lesson
	 * @param page
	 * @return
	 */
	public List<Lesson> getLessonListByType(Lesson lesson, int page);
	
	/**
	 * 获取数据页数
	 * @param num
	 * @param limit
	 * @return
	 */
	public int getPageByTotalNum(int num,int limit);
	
	/**
	 * 按ID查询课题的简要信息
	 * @param contentId
	 * @return
	 */
	public LessonContent getLessonContentById(int contentId);
	
	/**
	 * 更新课题内容
	 * @param lc
	 * @return
	 */
	public boolean updateLessonContent(LessonContent lc);
	
	/**
	 * 删除课题内容
	 * @param lessonContentId
	 * @return
	 */
	public boolean deleteLessonContent(int lessonContentId);
	
	/**
	 * 取消订阅
	 * @param subscribeId
	 * @return
	 */
	public boolean deleteSubscribeLesson(int subscribeId);
	
	/**
	 * 查询订阅课程是否通过
	 * @param ls
	 * @return
	 */
	public boolean getIsSubscribeLessonPass(LessonSubscribe ls);
	
	/**
	 * 查询课程的相关介绍
	 * @param lessonId
	 * @return
	 */
	public LessonInfo getLessonInfoById(int lessonId);
	
	/**
	 * 更新课程信息
	 * @param lesson
	 * @return
	 */
	public boolean updateLesson(Lesson lesson);
	
	/**
	 * 获取一级课程分类
	 * @return
	 */
	public List<LessonOneType> getLessonOneTypeList();
	
	/**
	 * 根据一级课程分类获取二级课程分类列表
	 * @param oneTypeId
	 * @return
	 */
	public List<LessonTwoType> getLessonTwoTypeListByOneType(int oneTypeId);
	
	/**
	 * 添加一级课程分类
	 * @param lot
	 * @return
	 */
	public boolean addLessonOneType(LessonOneType lot);
	
	/**
	 * 更新一级课程分类
	 * @param lot
	 * @return
	 */
	public boolean updateLessonOneType(LessonOneType lot);
	
	/**
	 * 删除一级课程分类
	 * @param oneTypeId
	 * @return
	 */
	public boolean deleteLessonOneType(int oneTypeId);
	
	/**
	 * 添加二级课程分类
	 * @param ltt
	 * @return
	 */
	public boolean addLessonTwoType(LessonTwoType ltt);
	
	/**
	 * 更新二级课程分类
	 * @param ltt
	 * @return
	 */
	public boolean updateLessonTwoType(LessonTwoType ltt);
	
	/**
	 * 删除二级课程分类
	 * @param twoTypeId
	 * @return
	 */
	public boolean deleteLessonTwoType(int twoTypeId);
	
	/**
	 * 获取热门课程
	 * @param start
	 * @param limit
	 * @return
	 */
	public List<Lesson> gethotLessonList(int start, int limit);
	
	/**
	 * 获取最新课程
	 * @param start
	 * @param limit
	 * @return
	 */
	public List<Lesson> getNewLessonList(int start, int limit);
	
	/**
	 * 获取热门课题列表
	 * @param start
	 * @param limit
	 * @return
	 */
	public List<LessonContent> getHotLessonContentList(int start, int limit);
	
	/**
	 * 获取最新课题列表
	 * @param start
	 * @param limit
	 * @return
	 */
	public List<LessonContent> getNewLessonContentList(int start, int limit);
	
	/**
	 * 当前获取订阅信息
	 * @param ls
	 * @return
	 */
	public LessonSubscribe getSubscribeLessonByLessonAndUser(LessonSubscribe ls);
}
